#ifndef	__INCLUDE_CRYANIMATION_STDAFX_H
#define __INCLUDE_CRYANIMATION_STDAFX_H

//#define NOT_USE_CRY_MEMORY_MANAGER
#include <CryModuleDefs.h>
#define eCryModule eCryM_Animation
#define CRYANIMATION_EXPORTS

//#define DEFINE_MODULE_NAME "CryAnimation"


#pragma once
//! Include standard headers.
#include <platform.h>

#if defined(USER_ivof) || defined(USER_ivo) || defined(USER_sven)
#define ASSERT_ON_ASSET_CHECKS
#endif

#ifdef ASSERT_ON_ASSET_CHECKS
#	define ANIM_ASSET_ASSERT_TRACE(condition, parenthese_message) CRY_ASSERT_TRACE(condition, parenthese_message)
#	define ANIM_ASSET_ASSERT(condition) CRY_ASSERT(condition)
#else
#	define ANIM_ASSET_ASSERT_TRACE(condition, parenthese_message)
#	define ANIM_ASSET_ASSERT(condition)
#endif

#define LOG_ASSET_PROBLEM(condition, parenthese_message)					\
	if (Console::GetInst().ca_AnimWarningLevel > 1)							\
	do																		\
	{																		\
		gEnv->pLog->LogWarning("Anim asset error: %s failed", #condition);	\
		gEnv->pLog->LogWarning parenthese_message;							\
	} while(0)

#define ANIM_ASSET_CHECK_TRACE(condition, parenthese_message)			\
	do																	\
	{																	\
		bool anim_asset_ok = (condition);								\
		if(!anim_asset_ok)												\
		{																\
			ANIM_ASSET_ASSERT_TRACE(anim_asset_ok, parenthese_message);	\
			LOG_ASSET_PROBLEM(condition, parenthese_message);			\
		}																\
	} while(0)

#define ANIM_ASSET_CHECK_MESSAGE(condition, message) ANIM_ASSET_CHECK_TRACE(condition, (message))
#define ANIM_ASSET_CHECK(condition) ANIM_ASSET_CHECK_MESSAGE(condition, NULL)


#pragma warning(disable : 4996) //'function': was declared deprecated
//#pragma warning(default:4018)	// signed/unsigned mismatch
//#pragma warning(default:4244)	// conversion from 'int' to 'float', possible loss of data
#pragma warning(default:4996)	// 'stricmp' was declared deprecated


//! Include main interfaces.
#include <Cry_Math.h>

#include <ISystem.h>
#include <ITimer.h>
#include <ILog.h>
#include <IConsole.h>
#include <ICryPak.h>
#include <StlUtils.h>

#include <ICryAnimation.h>
#include "AnimationBase.h"



#define SIZEOF_ARRAY(arr) (sizeof(arr)/sizeof((arr)[0]))

// maximum number of LODs per one geometric model (CryGeometry)
enum {g_nMaxGeomLodLevels = 6};

#include "CharacterManager.h"


// Check if file resource is locked.
extern bool IsResourceLocked( const char *filename );

//////////////////////////////////////////////////////////////////////////



inline void AnimWarning( const char *format,... ) PRINTF_PARAMS(1, 2);
inline void AnimWarning( const char *format,... )
{
	if (gEnv->IsDedicated() || !format)
		return;

	va_list args;
	va_start(args, format);
	GetISystem()->WarningV( VALIDATOR_MODULE_ANIMATION,VALIDATOR_WARNING,0,0,format ,args );
	va_end(args);
}





inline void AnimFileWarning( const char *file,const char *format,... ) PRINTF_PARAMS(2, 3);
inline void AnimFileWarning( const char *file,const char *format,... )
{
	if (gEnv->IsDedicated() || !format)
		return;

	va_list args;
	va_start(args, format);
	GetISystem()->WarningV( VALIDATOR_MODULE_ANIMATION, VALIDATOR_WARNING,VALIDATOR_FLAG_FILE,file,format ,args );
	va_end(args);
}


#endif

